package com.pureut.system.api.factory;

import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.system.api.SchedulingPlanFeignService;
import com.pureut.system.api.dto.SchedulingPlanDto;
import com.pureut.system.api.vo.BackAdjustVo;
import com.pureut.system.api.vo.BackWeight;
import com.pureut.system.api.vo.SchedulingPlanVo;
import com.pureut.system.api.vo.UpdateSaleVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

/**
 * 服务降级处理
 *
 * @author ruoyi
 */
@Component
public class RemoteSchedulingPlanFallbackFactory implements FallbackFactory<SchedulingPlanFeignService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteSchedulingPlanFallbackFactory.class);

    @Override
    public SchedulingPlanFeignService create(Throwable throwable) {
        log.error("服务调用失败:{}", throwable.getMessage());
        return new SchedulingPlanFeignService() {


            @Override
            public AjaxResult addPlan(List<SchedulingPlanVo> schedulingPlanVo) throws Exception {
                return null;
            }

            @Override
            public AjaxResult selectShiftSettingList(Long calendarId) {
                return null;
            }

            @Override
            public AjaxResult selectShiftLine(String lineCode) {
                return null;
            }

            @Override
            public AjaxResult backAdjust(BackAdjustVo backAdjustVo) {
                return null;
            }

            @Override
            public AjaxResult planBack(BackWeight backWeight) {
                return null;
            }

            @Override
            public AjaxResult updatePlanFinishStatus(BackWeight backWeight) {
                return null;
            }

            @Override
            public AjaxResult hoursOnById(long lineId, String materialCode) {
                return null;
            }

            @Override
            public Date finishTime(long lineId, long expStartTime, double expWhen) {
                return null;
            }

            @Override
            public String getPlanData(String planCode) {
                return null;
            }

            @Override
            public SchedulingPlanDto getPlanInfo(String planCode) {
                return null;
            }

            @Override
            public boolean updatePlanStatusUnit(UpdateSaleVo updateSaleVo) {
                return false;
            }

            @Override
            public AjaxResult planBackDelete(BackWeight backWeight) {
                return null;
            }


        };

    }
}
